home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-27 | 81.9 KB | 1,753 lines |
- @if-using not(ocl-file-sokoban)
- @use (ocl-file-sokoban)
- ( demand-load (
- ;OCL{{{}}}
- ;OCL{{{ reference description
- @if-using ( FUN-REFERENCE ) ; 1 ;
- This library defines a function for playing the well known game
- `Sokoban'. Therefor the file `~/.orisokoban' is used to store the game
- boards. The file will be generated automatically with language Inmos,
- to prevent problems with different fold marks. Each level is stored in
- a fold, using the following coding:
-
- @ref-start-item #
- wall
- @ref-end-item
- @ref-start-item .
- base
- @ref-end-item
- @ref-start-item $
- stone
- @ref-end-item
- @ref-start-item *
- stone on base
- @ref-end-item
- @ref-start-item @
- cursor
- @ref-end-item
- @ref-start-item +
- cursor on base
- @ref-end-item
-
- The library defines a own keyboard. So it can only be used for bindings
- with multiple modes. The mode is named `sokoban-kbd'. The functions
-
- @ref-start-picture
- soko-go-or-push-up, soko-run-or-push-up, soko-run-up
- soko-go-or-push-down, soko-run-or-push-down, soko-run-down
- soko-go-or-push-left, soko-run-or-push-left, soko-run-left
- soko-go-or-push-right, soko-run-or-push-right, soko-run-right
- @ref-end-picture
-
-
- are not undeclared, so they can be bound to your cursor keys. This
- library uses only the vi based bindings (hjkl).
-
- You have to define a function `SOKOBAN-RESET-KBD', which resets the
- keytables to your default table.
- @fi
- ;OCL}}}
- ;OCL{{{ libs
- @if-using not(ocl-file-buff-size) @lib buff-size @fi
- ;OCL}}}
- ;OCL{{{ variables
- ( defvar
- ( soko-regexp
- soko-homes
- soko-play
- soko-cmd
- soko-mv
- soko-pu
- soko-undo
- soko-undo-push
- soko-undo-move
- soko-undo-i-move
- soko-saved
- soko-saved-y
- soko-saved-x
- soko-saved-homes
- soko-saved-mv
- soko-saved-pu
- )
- )
- ;OCL}}}
- ;OCL{{{ define sokoban mode data
- ( defmodes sokoban-kbd )
- ( overload-prefix ( soko- ) )
- ;OCL}}}
- ;OCL{{{ sokoban
- ;OCL{{{ reference
- @if-using ( FUN-REFERENCE ) ; 2 ; sokoban-call-ref
- ;OCL{{{ sokoban
- You can play the well known game. You have to push the pakets to the
- bases. Bases are marked with `.'. Pakets are marked with `$', or `S'
- on bases. Running or pushing through walls (`#') is not possible.
-
- @ref-start-tbl Function 18 Key 3 Comment 36
- go-or-push-up @@ k @@
- run-or-push-up @@ K @@ repeat and stop at wall
- run-up @@ C-K @@ repeat and stop at wall or paket
- go-or-push-down @@ j @@
- run-or-push-down @@ J @@ repeat and stop at wall
- run-down @@ C-J @@ repeat and stop at wall or paket
- go-or-push-left @@ h @@
- run-or-push-left @@ H @@ repeat and stop at wall
- run-left @@ C-H @@ repeat and stop at wall or paket
- go-or-push-right @@ l @@
- run-or-push-right @@ L @@ repeat and stop at wall
- run-right @@ C-L @@ repeat and stop at wall or paket
- undo-last-move @@ u @@ if repeated, only the last one
-
- next-level @@ + @@ level has not to be solved
- previous-level @@ - @@
- save @@ s @@ not over different editing sessions
- reset @@ r @@ to last save or start, if no save
- restart-level @@ R @@ to start
-
- quit @@ q @@
- describe-bindings @@ ? @@
- @ref-end-tbl
-
- Starting a level calls save automatically!
- ;OCL}}}
- @fi
- ;OCL}}}
-
- ;OCL{{{ init boards
- ;OCL{{{ soko-init-long-wall
- ( deffun soko-init-long-wall
- ( do
- ( "#
- set soko-cmd -(soko-cmd 1)
- )
- while soko-cmd
- )
- )
- ;OCL}}}
- ;OCL{{{ soko-init-board-1
- ( deffun soko-init-board-1
- (
- ;OCL{{{ 1
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 5 set soko-cmd 5 soko-init-long-wall
- newline-and-indent goto 5 "# " " " "#
- newline-and-indent goto 5 "#$ " " "#
- newline-and-indent goto 3 "### " " "$##
- newline-and-indent goto 3 "# " " "$ " "$ " "#
- newline-and-indent goto 1 "### " "# " "## " "# " " " set soko-cmd 6 soko-init-long-wall
- newline-and-indent goto 1 "# " " " "# " "## " set soko-cmd 5 soko-init-long-wall " " "..#
- newline-and-indent goto 1 "# " "$ " " "$ goto 17 "..#
- newline-and-indent goto 1 set soko-cmd 5 soko-init-long-wall " "### " "#@## " " "..#
- newline-and-indent goto 5 "# " " " " " set soko-cmd 9 soko-init-long-wall
- newline-and-indent goto 5 set soko-cmd 7 soko-init-long-wall
- close-fold
- next-line
- ;OCL}}}
- ;OCL{{{ 2
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 1 set soko-cmd 12 soko-init-long-wall
- newline-and-indent goto 1 "#.. " " "# " " " " " "###
- newline-and-indent goto 1 "#.. " " "# " "$ " " "$ " " "#
- newline-and-indent goto 1 "#.. " " "#$#### " " "#
- newline-and-indent goto 1 "#.. " " " " "@ " "## " " "#
- newline-and-indent goto 1 "#.. " " "# " "# " " "$ " "##
- newline-and-indent goto 1 set soko-cmd 6 soko-init-long-wall " "##$ " "$ " "#
- newline-and-indent goto 3 "# " "$ " " "$ " "$ " "$ " "#
- newline-and-indent goto 3 "# " " " " "# " " " " " "#
- newline-and-indent goto 3 set soko-cmd 12 soko-init-long-wall
- close-fold
- next-line
- ;OCL}}}
- ;OCL{{{ 3
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 9 set soko-cmd 8 soko-init-long-wall
- newline-and-indent goto 9 "# " " " " " "@#
- newline-and-indent goto 9 "# " "$#$ " "##
- newline-and-indent goto 9 "# " "$ " " "$#
- newline-and-indent goto 9 "##$ " "$ " "#
- newline-and-indent goto 1 set soko-cmd 9 soko-init-long-wall " "$ " "# " "###
- newline-and-indent goto 1 "#.... " " "## " "$ " " "$ " " "#
- newline-and-indent goto 1 "##... " " " " "$ " " "$ " " " "#
- newline-and-indent goto 1 "#.... " " set soko-cmd 10 soko-init-long-wall
- newline-and-indent goto 1 set soko-cmd 8 soko-init-long-wall
- close-fold
- next-line
- ;OCL}}}
- ;OCL{{{ 4
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 12 set soko-cmd 8 soko-init-long-wall
- newline-and-indent goto 12 "# " " "....#
- newline-and-indent goto 1 set soko-cmd 12 soko-init-long-wall " " "....#
- newline-and-indent goto 1 "# " " " " "# " " "$ " "$ " " " "....#
- newline-and-indent goto 1 "# " "$$ "$#$ " " "$ " "# " " "....#
- newline-and-indent goto 1 "# " " "$ " " " " " "$ " "# " " "....#
- newline-and-indent goto 1 "# " "$$ " "#$ " "$ " "$ set soko-cmd 8 soko-init-long-wall
- newline-and-indent goto 1 "# " " "$ " "# " " " " " "#
- newline-and-indent goto 1 "## " set soko-cmd 9 soko-init-long-wall
- newline-and-indent goto 1 "# " " " " "# " " " " "##
- newline-and-indent goto 1 "# " " " " " "$ " " " "##
- newline-and-indent goto 1 "# " " "$$ "#$$ " " "@#
- newline-and-indent goto 1 "# " " " " "# " " " " "##
- newline-and-indent goto 1 set soko-cmd 11 soko-init-long-wall
- close-fold
- next-line
- ;OCL}}}
- ;OCL{{{ 5
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 9 set soko-cmd 5 soko-init-long-wall
- newline-and-indent goto 9 "# " " " set soko-cmd 5 soko-init-long-wall
- newline-and-indent goto 9 "# " "#$## " " "#
- newline-and-indent goto 9 "# " " " " " "$ " "#
- newline-and-indent goto 1 set soko-cmd 9 soko-init-long-wall " "### " " " "#
- newline-and-indent goto 1 "#.... " " "## " "$ " " "$###
- newline-and-indent goto 1 "#.... " " " " "$ " "$$ " "##
- newline-and-indent goto 1 "#.... " " "##$ " " "$ " "@#
- newline-and-indent goto 1 set soko-cmd 9 soko-init-long-wall " " "$ " " "##
- newline-and-indent goto 9 "# " "$ " "$ " " "#
- newline-and-indent goto 9 "### " "## " "#
- newline-and-indent goto 11 "# " " " " "#
- newline-and-indent goto 11 set soko-cmd 6 soko-init-long-wall
- close-fold
- next-line
- ;OCL}}}
- ;OCL{{{ 6
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 1 set soko-cmd 6 soko-init-long-wall " " "###
- newline-and-indent goto 1 "#.. " " "# " "##@##
- newline-and-indent goto 1 "#.. " " "### " " " "#
- newline-and-indent goto 1 "#.. " " " " " "$$ " "#
- newline-and-indent goto 1 "#.. " " "# " "# " "$ " "#
- newline-and-indent goto 1 "#..### " "# " "$ " "#
- newline-and-indent goto 1 "#### " "$ " "#$ " " "#
- newline-and-indent goto 4 "# " " "$# " "$ " "#
- newline-and-indent goto 4 "# " "$ " " "$ " " "#
- newline-and-indent goto 4 "# " " "## " " " "#
- newline-and-indent goto 4 set soko-cmd 9 soko-init-long-wall
- close-fold
- next-line
- ;OCL}}}
- ;OCL{{{ 7
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 8 set soko-cmd 5 soko-init-long-wall
- newline-and-indent goto 2 set soko-cmd 7 soko-init-long-wall " " " "##
- newline-and-indent goto 1 "## " "# " "@## " "$$ " "#
- newline-and-indent goto 1 "# " " " " "$ goto 13 "#
- newline-and-indent goto 1 "# " " "$ " " "### " " " "#
- newline-and-indent goto 1 "### " set soko-cmd 5 soko-init-long-wall "$###
- newline-and-indent goto 1 "# " "$ " " "### " "..#
- newline-and-indent goto 1 "# " "$ " "$ " "$ " "...#
- newline-and-indent goto 1 "# " " " " "###...#
- newline-and-indent goto 1 "# " "$$ " "# " "#...#
- newline-and-indent goto 1 "# " " "### " set soko-cmd 5 soko-init-long-wall
- newline-and-indent goto 1 "####
- close-fold
- next-line
- ;OCL}}}
- ;OCL{{{ 8
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 3 "####
- newline-and-indent goto 3 "# " " set soko-cmd 11 soko-init-long-wall
- newline-and-indent goto 3 "# " " " " "$ " " " "$ " "$ " "#
- newline-and-indent goto 3 "# " "$# " "$ " "# " " "$ " " "#
- newline-and-indent goto 3 "# " " "$ " "$ " " "# " " " " "#
- newline-and-indent goto 1 "### " "$# " "# " " "#### " "#
- newline-and-indent goto 1 "#@#$ " "$ " "$ " " "## " " " "#
- newline-and-indent goto 1 "# " " " " "$ " "#$# " " " "# " "#
- newline-and-indent goto 1 "# " " " "$ " " " " "$ " "$ " "$ " "#
- newline-and-indent goto 1 set soko-cmd 5 soko-init-long-wall " " set soko-cmd 9 soko-init-long-wall
- newline-and-indent goto 3 "# goto 10 "#
- double-line
- newline-and-indent goto 3 "#......#
- double-line
- double-line
- newline-and-indent goto 3 set soko-cmd 8 soko-init-long-wall
- close-fold
- next-line
- ;OCL}}}
- ;OCL{{{ 9
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 11 set soko-cmd 7 soko-init-long-wall
- newline-and-indent goto 11 "# " " "...#
- newline-and-indent goto 7 set soko-cmd 5 soko-init-long-wall " " "...#
- newline-and-indent goto 7 "# goto 14 ". " ".#
- newline-and-indent goto 7 "# " " "## " " "...#
- newline-and-indent goto 7 "## " "## " " "...#
- newline-and-indent goto 6 "### " set soko-cmd 8 soko-init-long-wall
- newline-and-indent goto 6 "# " "$$ "$ " "##
- newline-and-indent goto 2 set soko-cmd 5 soko-init-long-wall " " "$ " "$ " set soko-cmd 5 soko-init-long-wall
- newline-and-indent goto 1 "## " " " "#$ " "$ " " " "# " " " "#
- newline-and-indent goto 1 "#@ " "$ " " "$ " " " " "$ " " "$ " "#
- newline-and-indent goto 1 set soko-cmd 6 soko-init-long-wall " "$$ " "$ " set soko-cmd 5 soko-init-long-wall
- newline-and-indent goto 6 "# goto 13 "#
- newline-and-indent goto 6 set soko-cmd 8 soko-init-long-wall
- close-fold
- next-line
- ;OCL}}}
- ;OCL{{{ 10
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 2 "### " " set soko-cmd 13 soko-init-long-wall
- newline-and-indent goto 1 "##@#### goto 15 "# " " " "#
- newline-and-indent goto 1 "# " "$$ " " " "$$ " " "$ " "$ " "...#
- newline-and-indent goto 1 "# " " "$$ "$# " " " " "$ " " "#...#
- newline-and-indent goto 1 "# " "$ " " " "# " "$$ " "$$ " "#...#
- newline-and-indent goto 1 "### " " " "# " " "$ " " " " "#...#
- newline-and-indent goto 1 "# " " " " " "# " "$ " "$ " "$ " "#...#
- newline-and-indent goto 1 "# " " " " set soko-cmd 6 soko-init-long-wall " "###...#
- newline-and-indent goto 1 "## " "# " " "# " " "$ " "$ " " "#...#
- newline-and-indent goto 1 "# " " "## " "# " "$$ " "$ " "$##..#
- newline-and-indent goto 1 "# " "..# " "# " " "$ goto 17 "#.#
- newline-and-indent goto 1 "# " "..# " "# " "$$ "$ " "$$ "$ " "#.#
- newline-and-indent goto 1 set soko-cmd 5 soko-init-long-wall " "# goto 15 "# " "#.#
- newline-and-indent goto 5 "# " set soko-cmd 9 soko-init-long-wall " "#.#
- newline-and-indent goto 5 "# goto 17 "#.#
- newline-and-indent goto 5 set soko-cmd 15 soko-init-long-wall
- close-fold
- next-line
- ;OCL}}}
- )
- )
- ;OCL}}}
- ;OCL{{{ soko-init-board-2
- ( deffun soko-init-board-2
- (
- ;OCL{{{ 11
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 11 "####
- newline-and-indent goto 6 "#### " "# " " "#
- newline-and-indent goto 4 "### " "@###$ " "#
- newline-and-indent goto 3 "## goto 11 "$ " " "#
- newline-and-indent goto 2 "## " " "$ " "$$ "## " "##
- newline-and-indent goto 2 "# " " "#$## " " " " " "#
- newline-and-indent goto 2 "# " "# " "$ " "$$ " "# " "###
- newline-and-indent goto 2 "# " " " "$ " "# " " "# " "$ " set soko-cmd 5 soko-init-long-wall
- newline-and-indent goto 1 "#### " " " " "# " " "$$ " "# " " " "#
- newline-and-indent goto 1 "#### " "## " "$ goto 19 "#
- newline-and-indent goto 1 "#. " " " " "### " " set soko-cmd 8 soko-init-long-wall
- newline-and-indent goto 1 "#.. " "..# " "####
- newline-and-indent goto 1 "#...#.#
- newline-and-indent goto 1 "#.....#
- newline-and-indent goto 1 set soko-cmd 7 soko-init-long-wall
- close-fold
- next-line
- ;OCL}}}
- ;OCL{{{ 12
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 1 set soko-cmd 16 soko-init-long-wall
- newline-and-indent goto 1 "# goto 16 "#
- newline-and-indent goto 1 "# " "# " set soko-cmd 6 soko-init-long-wall " " " " " "#
- newline-and-indent goto 1 "# " "# " " "$ " "$ " "$ " "$# " " "#
- newline-and-indent goto 1 "# " "# " " " "$@$ " " " "## " "##
- newline-and-indent goto 1 "# " "# " " "$ " "$ " "$###...#
- newline-and-indent goto 1 "# " "# " " " "$ " "$ " " "##...#
- newline-and-indent goto 1 "# " "###$$ "$ " "$ " "##...#
- newline-and-indent goto 1 "# " " " " " "# " "## " "##...#
- newline-and-indent goto 1 set soko-cmd 5 soko-init-long-wall " " " "## " "##...#
- newline-and-indent goto 5 set soko-cmd 5 soko-init-long-wall " " " " " "###
- newline-and-indent goto 9 "# " " " " " "#
- newline-and-indent goto 9 set soko-cmd 7 soko-init-long-wall
- close-fold
- next-line
- ;OCL}}}
- ;OCL{{{ 13
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 4 set soko-cmd 9 soko-init-long-wall
- newline-and-indent goto 3 "## " " " "## " " set soko-cmd 5 soko-init-long-wall
- newline-and-indent goto 1 "### " " " " " "# " " "# " " " " "###
- newline-and-indent goto 1 "# " " "$ " "#$ " "# " " "# " " "... " "#
- newline-and-indent goto 1 "# " "# " "$#@$## " "# " "#.#. " "#
- newline-and-indent goto 1 "# " " "# " "#$ " " "# " " " " ". " ". " "#
- newline-and-indent goto 1 "# " "$ " " " " "$ " "# " "# " "#.#. " "#
- newline-and-indent goto 1 "# " " " "## " " "##$ " "$ " ". " ". " "#
- newline-and-indent goto 1 "# " "$ " "# " " " "# " " "#$#.#. " "#
- newline-and-indent goto 1 "## " "$ " " "$ " " " "$ " " "$... " "#
- newline-and-indent goto 2 "#$ " set soko-cmd 6 soko-init-long-wall " " " " "## " " "#
- newline-and-indent goto 2 "# " " "# " " " " set soko-cmd 10 soko-init-long-wall
- newline-and-indent goto 2 "####
- close-fold
- next-line
- ;OCL}}}
- ;OCL{{{ 14
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 8 set soko-cmd 7 soko-init-long-wall
- newline-and-indent goto 2 set soko-cmd 7 soko-init-long-wall " " " " " "#
- newline-and-indent goto 2 "# " " " " " "# " "$@$ " "#
- newline-and-indent goto 2 "#$$ " "# " " " set soko-cmd 9 soko-init-long-wall
- newline-and-indent goto 2 "# " "###......## " " " "#
- newline-and-indent goto 2 "# " " " "$......## " "# " "#
- newline-and-indent goto 2 "# " "###...... " " " " " "#
- newline-and-indent goto 1 "## " " " "#### " "### " "#$##
- newline-and-indent goto 1 "# " " "#$ " " " "# " " "$ " " "# " "#
- newline-and-indent goto 1 "# " " "$ " "$$ "$ " " "# " "$## " "#
- newline-and-indent goto 1 "# " " " "$ " "$ " "###$$ " "# " "#
- newline-and-indent goto 1 set soko-cmd 5 soko-init-long-wall " " " " " "$ " " " "# " "#
- newline-and-indent goto 5 "### " "### " " " "# " "#
- newline-and-indent goto 7 "# " " " " " "# " " " "#
- newline-and-indent goto 7 set soko-cmd 8 soko-init-long-wall " " "#
- newline-and-indent goto 14 "####
- close-fold
- next-line
- ;OCL}}}
- ;OCL{{{ 15
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 4 set soko-cmd 8 soko-init-long-wall
- newline-and-indent goto 4 "# " " " "# " " "#
- newline-and-indent goto 4 "# " " "$ " " " "#
- newline-and-indent goto 2 "### " "#$ " " " "####
- newline-and-indent goto 2 "# " " "$ " " "##$ " " " "#
- newline-and-indent goto 2 "# " " "# " "@ " "$ " "# " "$#
- newline-and-indent goto 2 "# " " "# goto 12 "$ " "####
- newline-and-indent goto 2 "## " "####$## " " " " " "#
- newline-and-indent goto 2 "# " "$#.....# " "# " " " "#
- newline-and-indent goto 2 "# " " "$..**. " "$# " "###
- newline-and-indent goto 1 "## " " "#.....# " " " "#
- newline-and-indent goto 1 "# " " " "### " set soko-cmd 7 soko-init-long-wall
- newline-and-indent goto 1 "# " "$$ " " "# " " "#
- newline-and-indent goto 1 "# " " "# " " " " " "#
- newline-and-indent goto 1 set soko-cmd 6 soko-init-long-wall " " " "#
- newline-and-indent goto 6 set soko-cmd 5 soko-init-long-wall
- close-fold
- next-line
- ;OCL}}}
- ;OCL{{{ 16
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 1 set soko-cmd 5 soko-init-long-wall
- newline-and-indent goto 1 "# " " " "##
- newline-and-indent goto 1 "# " " " " "# " " "####
- newline-and-indent goto 1 "# " "$ " " "#### " " "#
- newline-and-indent goto 1 "# " " "$$ " "$ " " " "$#
- newline-and-indent goto 1 "###@ " "#$ " " " " "##
- newline-and-indent goto 2 "# " " "## " " "$ " "$ " "##
- newline-and-indent goto 2 "# " "$ " " "## " "## " ".#
- newline-and-indent goto 2 "# " " "#$##$ " " "#.#
- newline-and-indent goto 2 "### " " " "$..##.#
- newline-and-indent goto 3 "# " " " " "#.*...#
- newline-and-indent goto 3 "# " "$$ " "#.....#
- newline-and-indent goto 3 "# " " set soko-cmd 9 soko-init-long-wall
- newline-and-indent goto 3 "# " " "#
- newline-and-indent goto 3 "####
- close-fold
- next-line
- ;OCL}}}
- ;OCL{{{ 17
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 4 set soko-cmd 10 soko-init-long-wall
- newline-and-indent goto 4 "#.. " " "# " " " "#
- newline-and-indent goto 4 "#.. goto 13 "#
- newline-and-indent goto 4 "#.. " " "# " " "####
- newline-and-indent goto 3 set soko-cmd 7 soko-init-long-wall " " "# " " "##
- newline-and-indent goto 3 "# goto 16 "#
- newline-and-indent goto 3 "# " " "# " " "## " " "# " " "#
- newline-and-indent goto 1 "#### " "## " " "#### " "##
- newline-and-indent goto 1 "# " " "$ " " set soko-cmd 5 soko-init-long-wall " "# " " "#
- newline-and-indent goto 1 "# " "# " "$ " " "$ " " "# " "$ " " "#
- newline-and-indent goto 1 "# " "@$ " " "$ " " " "# " " " "##
- newline-and-indent goto 1 "#### " "## " set soko-cmd 7 soko-init-long-wall
- newline-and-indent goto 4 "# " " " " "#
- newline-and-indent goto 4 set soko-cmd 6 soko-init-long-wall
- close-fold
- next-line
- ;OCL}}}
- ;OCL{{{ 18
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 6 set soko-cmd 11 soko-init-long-wall
- newline-and-indent goto 6 "# " " ". " " "# " " " "#
- newline-and-indent goto 6 "# " "#. " " " " "@ " "#
- newline-and-indent goto 2 set soko-cmd 5 soko-init-long-wall " "##..# " "####
- newline-and-indent goto 1 "## " " "# " "..### " " " " " "###
- newline-and-indent goto 1 "# " "$ " "#... " " " "$ " "# " " "$ " "#
- newline-and-indent goto 1 "# " " " " ".. " "## " " "## " "## " "#
- newline-and-indent goto 1 "####$##$# " "$ " "# " " " "# " "#
- newline-and-indent goto 3 "## " "# " " " " "#$ " "$$ " "# " "#
- newline-and-indent goto 3 "# " " "$ " "# " "# " " "# " "$## " "#
- newline-and-indent goto 3 "# goto 19 "#
- newline-and-indent goto 3 "# " " set soko-cmd 11 soko-init-long-wall " " "#
- newline-and-indent goto 3 "#### goto 16 "####
- close-fold
- next-line
- ;OCL}}}
- ;OCL{{{ 19
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 3 set soko-cmd 6 soko-init-long-wall
- newline-and-indent goto 3 "# " " " "@####
- newline-and-indent goto 1 set soko-cmd 5 soko-init-long-wall " "$ " " " "#
- newline-and-indent goto 1 "# " " " "## " " " " "####
- newline-and-indent goto 1 "# " "$ " "# " " "## " " " " "#
- newline-and-indent goto 1 "# " "$ " "# " " set soko-cmd 5 soko-init-long-wall " "#
- newline-and-indent goto 1 "## " "$ " " "$ " " " " "# " "#
- newline-and-indent goto 1 "## " "$ " "$ " "### " "# " "#
- newline-and-indent goto 1 "## " "# " " "$ " " "# " "# " "#
- newline-and-indent goto 1 "## " "# " "#$# " " " "# " "#
- newline-and-indent goto 1 "## " "### " " " "# " "# " set soko-cmd 6 soko-init-long-wall
- newline-and-indent goto 1 "# " " "$ " " "#### " "# " "#....#
- newline-and-indent goto 1 "# " " " " "$ " " " " "$ " " " "..#.#
- newline-and-indent goto 1 "####$ " " "$# " "$ " " " "....#
- newline-and-indent goto 1 "# goto 9 "# " " "## " "....#
- newline-and-indent goto 1 set soko-cmd 19 soko-init-long-wall
- close-fold
- next-line
- ;OCL}}}
- ;OCL{{{ 20
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 5 set soko-cmd 10 soko-init-long-wall
- newline-and-indent goto 1 set soko-cmd 5 soko-init-long-wall goto 14 "####
- newline-and-indent goto 1 "# " " " " " "# " " " "$ " " "#@ " "#
- newline-and-indent goto 1 "# " set soko-cmd 7 soko-init-long-wall "$#### " " "###
- newline-and-indent goto 1 "# " "# " " " " "## " "# " " "#$ " "..#
- newline-and-indent goto 1 "# " "# " "$ " " " " " "# " " "# " " "#.#
- newline-and-indent goto 1 "# " "# " "$ " " "# " " " " " "#$ " "..#
- newline-and-indent goto 1 "# " "# " " "### " "## " " " " " "#.#
- newline-and-indent goto 1 "# " "### " " "# " " "# " " "#$ " "..#
- newline-and-indent goto 1 "# " "# " " " " "# " " "#### " " "#.#
- newline-and-indent goto 1 "# " "#$ " " " "$ " " "$ " " "#$ " "..#
- newline-and-indent goto 1 "# " " " " "$ " "# " "$ " "$ " "# " " "#.#
- newline-and-indent goto 1 "#### " "$### " " " " "#$ " "..#
- newline-and-indent goto 4 "# " " " " "$$ " "###....#
- newline-and-indent goto 4 "# goto 11 "## " set soko-cmd 6 soko-init-long-wall
- newline-and-indent goto 4 set soko-cmd 8 soko-init-long-wall
- close-fold
- next-line
- ;OCL}}}
- )
- )
- ;OCL}}}
- ;OCL{{{ soko-init-board-3
- ( deffun soko-init-board-3
- (
- ;OCL{{{ 21
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 1 set soko-cmd 9 soko-init-long-wall
- newline-and-indent goto 1 "# goto 9 "#
- newline-and-indent goto 1 "# goto 9 "####
- newline-and-indent goto 1 "## " "#### " "# " " "#
- newline-and-indent goto 1 "## " "#@## " " " " "#
- newline-and-indent goto 1 "# " "$$ "$ " "$ " " "$$ "#
- newline-and-indent goto 1 "# " " "# " "## " "$ " " "#
- newline-and-indent goto 1 "# " " "# " "## " " "$ " "####
- newline-and-indent goto 1 "#### " " "$$ "$ " "$# " " "#
- newline-and-indent goto 2 "# " " " "## " " " "....#
- newline-and-indent goto 2 "# " "# " " " "# " "#.. " ".#
- newline-and-indent goto 2 "# " " " "# " "# " "##...#
- newline-and-indent goto 2 set soko-cmd 5 soko-init-long-wall " "$ " " "#...#
- newline-and-indent goto 6 "## " " " set soko-cmd 5 soko-init-long-wall
- newline-and-indent goto 7 set soko-cmd 5 soko-init-long-wall
- close-fold
- next-line
- ;OCL}}}
- ;OCL{{{ 22
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 1 set soko-cmd 6 soko-init-long-wall " " " " " "####
- newline-and-indent goto 1 "# " " " " set soko-cmd 7 soko-init-long-wall " " set soko-cmd 5 soko-init-long-wall
- newline-and-indent goto 1 "# " " " "$# " " "# " " "$ " " "# " " " "#
- newline-and-indent goto 1 "# " " "$ " " "$ " " "$ " "# " "$ " "$ " " "#
- newline-and-indent goto 1 "##$ " "$ " " " "# " "@# " "$ " " " " "#
- newline-and-indent goto 1 "# " " "$ " set soko-cmd 11 soko-init-long-wall " "##
- newline-and-indent goto 1 "# " "# " " " "#.......# " "$#
- newline-and-indent goto 1 "# " "## " " "# " "......# " " "#
- newline-and-indent goto 1 "# " "# " " " "$........$ " "#
- newline-and-indent goto 1 "# " "# " "$ " "#.... " "..# " " "#
- newline-and-indent goto 1 "# " " "$ " "$####$#### " "$#
- newline-and-indent goto 1 "# " "$ " " " "### " "$ " " " "$ " " "##
- newline-and-indent goto 1 "# " "$ " " " " " "$ " "$ " " "$ " " " " "#
- newline-and-indent goto 1 "## " set soko-cmd 6 soko-init-long-wall " "$ " set soko-cmd 5 soko-init-long-wall " "#
- newline-and-indent goto 1 "# goto 11 "# goto 19 "#
- newline-and-indent goto 1 set soko-cmd 19 soko-init-long-wall
- close-fold
- next-line
- ;OCL}}}
- ;OCL{{{ 23
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 5 set soko-cmd 7 soko-init-long-wall
- newline-and-indent goto 5 "# " " "# " " "####
- newline-and-indent goto 1 set soko-cmd 5 soko-init-long-wall " "$#$ " "# " " "##
- newline-and-indent goto 1 "#.. " "# " " "# " " "# " " " "#
- newline-and-indent goto 1 "#.. " "# " "$#$ " "# " " "$####
- newline-and-indent goto 1 "#. " " "# " " " " " "#$ " " "# " " "#
- newline-and-indent goto 1 "#.. " " " "$# " " "# " "$ " " " " "#
- newline-and-indent goto 1 "#..@# " " "#$ " "#$ " " "# " " "#
- newline-and-indent goto 1 "#.. " "# " "$# " " " " " "$# " " "#
- newline-and-indent goto 1 "#.. " "# " " "#$$ "#$ " " "# " " "##
- newline-and-indent goto 1 "#.. " "# " "$# " " "# " " "$#$ " " "#
- newline-and-indent goto 1 "#.. " "# " " "# " " "# " " " "# " " " "#
- newline-and-indent goto 1 "##. " "#### " " set soko-cmd 5 soko-init-long-wall " " " "#
- newline-and-indent goto 2 "#### " " "#### " " " set soko-cmd 5 soko-init-long-wall
- close-fold
- next-line
- ;OCL}}}
- ;OCL{{{ 24
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 1 set soko-cmd 15 soko-init-long-wall
- newline-and-indent goto 1 "#.......... " " ".####
- newline-and-indent goto 1 "#..........$$ ".# " " "#
- newline-and-indent goto 1 set soko-cmd 11 soko-init-long-wall "$ " "# " " " "##
- newline-and-indent goto 1 "# goto 8 "$ " " "$ " " " " " "$ " "#
- newline-and-indent goto 1 "## " "#### " " " "# " " "$ " "# " " "#
- newline-and-indent goto 1 "# goto 8 "# " " " "## " " "# " "##
- newline-and-indent goto 1 "# " " "$# " " "# " "## " " "### " "##
- newline-and-indent goto 1 "# " "$ " "#$### " " " " "### " "##
- newline-and-indent goto 1 "### " " "$ " "# " " "# " " "### " "##
- newline-and-indent goto 1 "### " " " " "$ " "## " "# " " "# " "##
- newline-and-indent goto 2 "# " "$ " " "# " " "$ " " "$ " "$ " " " "#
- newline-and-indent goto 2 "# " " "$ " " "$#$$ "$ " " "# " " " "#
- newline-and-indent goto 2 "# " " "# " " "$ goto 15 set soko-cmd 5 soko-init-long-wall
- newline-and-indent goto 2 "# " "@## " " "# " " "# " " "#
- newline-and-indent goto 2 set soko-cmd 14 soko-init-long-wall
- close-fold
- next-line
- ;OCL}}}
- ;OCL{{{ 25
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 1 "####
- newline-and-indent goto 1 "# " " set soko-cmd 14 soko-init-long-wall
- newline-and-indent goto 1 "# " " "# " " " "..#......#
- newline-and-indent goto 1 "# " " "# " "# " set soko-cmd 5 soko-init-long-wall " "...#
- newline-and-indent goto 1 "##$# " " " " "........#
- newline-and-indent goto 1 "# " " " "##$ set soko-cmd 6 soko-init-long-wall " " "####
- newline-and-indent goto 1 "# " "$ " "# " " " " " set soko-cmd 6 soko-init-long-wall "@ " "#
- newline-and-indent goto 1 "##$ " "# " "$ " " " set soko-cmd 6 soko-init-long-wall " " "#
- newline-and-indent goto 1 "# " " "$ " "#$$ "$## goto 19 "#
- newline-and-indent goto 1 "# goto 8 "# " " " " "#$#$###
- newline-and-indent goto 1 "# " "#### " "#$$ "$$ "$ " " " " "#
- newline-and-indent goto 1 "# " "# " " " " "$ " " " " " "# " " " "#
- newline-and-indent goto 1 "# " "# " " " "## goto 17 "###
- newline-and-indent goto 1 "# " set soko-cmd 6 soko-init-long-wall "$ set soko-cmd 6 soko-init-long-wall " "$ " "#
- newline-and-indent goto 1 "# goto 10 "# " " " " "# " " " "#
- newline-and-indent goto 1 set soko-cmd 10 soko-init-long-wall " " " " set soko-cmd 5 soko-init-long-wall
- close-fold
- next-line
- ;OCL}}}
- ;OCL{{{ 26
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 2 set soko-cmd 7 soko-init-long-wall
- newline-and-indent goto 2 "# " " "# " " set soko-cmd 5 soko-init-long-wall
- newline-and-indent goto 1 "## " " "# " " "#...###
- newline-and-indent goto 1 "# " " "$# " " "#... " " "#
- newline-and-indent goto 1 "# " "$ " "#$$ " "... " " "#
- newline-and-indent goto 1 "# " " "$# " " "#... " ".#
- newline-and-indent goto 1 "# " " " "# " "$ set soko-cmd 8 soko-init-long-wall
- newline-and-indent goto 1 "##$ goto 11 "$ " "$ " "#
- newline-and-indent goto 1 "## " " "# " " "$$ " "# " " " "#
- newline-and-indent goto 2 set soko-cmd 6 soko-init-long-wall " " "##$$ "@#
- newline-and-indent goto 7 "# goto 14 "##
- newline-and-indent goto 7 set soko-cmd 8 soko-init-long-wall
- close-fold
- next-line
- ;OCL}}}
- ;OCL{{{ 27
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 2 set soko-cmd 17 soko-init-long-wall
- newline-and-indent goto 2 "#... " " " "# " " " " "# " " " "##
- newline-and-indent goto 1 "##..... " " "$## " "# " "#$ " "#
- newline-and-indent goto 1 "#......# " " "$ " " "# " " " " "#
- newline-and-indent goto 1 "#......# " " "# " " "# " "# " " "#
- newline-and-indent goto 1 set soko-cmd 9 soko-init-long-wall " "$ " " "$ " "$ " " "#
- newline-and-indent goto 3 "# " " " " " "#$##$ " "##$##
- newline-and-indent goto 2 "## " " " "$ " " " " "# " "$ " " " " "#
- newline-and-indent goto 2 "# " " "## " "### " "# " " "##$ " "#
- newline-and-indent goto 2 "# " "$ " "$$ " " " " " "$ " " "$ " " "#
- newline-and-indent goto 2 "# " "$ " " " " "$##$ " set soko-cmd 6 soko-init-long-wall
- newline-and-indent goto 2 set soko-cmd 7 soko-init-long-wall " " "@ " "##
- newline-and-indent goto 8 set soko-cmd 6 soko-init-long-wall
- close-fold
- next-line
- ;OCL}}}
- ;OCL{{{ 28
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 10 set soko-cmd 5 soko-init-long-wall
- newline-and-indent goto 6 set soko-cmd 5 soko-init-long-wall " " " "#
- newline-and-indent goto 5 "## " "$ " " "$ " " "####
- newline-and-indent goto 1 set soko-cmd 5 soko-init-long-wall " "$ " " "$ " "$ " "##.#
- newline-and-indent goto 1 "# goto 9 "$$ " " "##..#
- newline-and-indent goto 1 "# " " set soko-cmd 6 soko-init-long-wall " "###.. " "#
- newline-and-indent goto 1 "## " "# " " "# " " " " "#... " "#
- newline-and-indent goto 1 "# " "$ " " " "# " " " " "#... " "#
- newline-and-indent goto 1 "#@ " "#$ " "## " "####...#
- newline-and-indent goto 1 "#### " " "$ " "$$ " " "##..#
- newline-and-indent goto 4 "## " " "$ " "$ " " "$...#
- newline-and-indent goto 5 "# " "$$ " " "$ " "# " " ".#
- newline-and-indent goto 5 "# " " " "$ " "$ " " "####
- newline-and-indent goto 5 set soko-cmd 6 soko-init-long-wall " " " "#
- newline-and-indent goto 10 set soko-cmd 5 soko-init-long-wall
- close-fold
- next-line
- ;OCL}}}
- ;OCL{{{ 29
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 1 set soko-cmd 5 soko-init-long-wall
- newline-and-indent goto 1 "# " " " "##
- newline-and-indent goto 1 "# " "$ " " set soko-cmd 9 soko-init-long-wall
- newline-and-indent goto 1 "## " "# " "# goto 14 set soko-cmd 6 soko-init-long-wall
- newline-and-indent goto 1 "## " "# " " " "$#$#@ " " "# " " " "#
- newline-and-indent goto 1 "# " " "# goto 11 "$ " "# " " " "$ " "#
- newline-and-indent goto 1 "# " " "### " set soko-cmd 9 soko-init-long-wall " "##
- newline-and-indent goto 1 "# " " "## " "..*..... " "# " "##
- newline-and-indent goto 1 "## " "## " "*.*..*.* " "# " "##
- newline-and-indent goto 1 "# " "$ set soko-cmd 10 soko-init-long-wall " "##$ " "#
- newline-and-indent goto 1 "# " " "$ " " " "$ " " "$ " " " " "$ " " "#
- newline-and-indent goto 1 "# " " "# " " " "# " " " "# " " " "# " " "#
- newline-and-indent goto 1 set soko-cmd 19 soko-init-long-wall
- close-fold
- next-line
- ;OCL}}}
- ;OCL{{{ 30
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 8 set soko-cmd 11 soko-init-long-wall
- newline-and-indent goto 8 "# " " " "# " " " " " "#
- newline-and-indent goto 1 set soko-cmd 5 soko-init-long-wall " " "# " " " " " "$ " "$ " "#
- newline-and-indent goto 1 "# " " " set soko-cmd 5 soko-init-long-wall " "$## " "# " "##
- newline-and-indent goto 1 "# " "$ " "## " " " "# " "## " "$ " " "#
- newline-and-indent goto 1 "# " "$ " " "@$$ " "# " "##$$ "$ " "#
- newline-and-indent goto 1 "## " "### " " " "# " "## " " " " "#
- newline-and-indent goto 1 "## " "# " " " "### " set soko-cmd 5 soko-init-long-wall "$#
- newline-and-indent goto 1 "## " "# " " " " " "$ " " "#....#
- newline-and-indent goto 1 "# " " "### " "## " "$ " "#....##
- newline-and-indent goto 1 "# " "$ " " " "$ " "# " " " "#..$. " "#
- newline-and-indent goto 1 "# " " "## " "$ " "# " " "##.... " "#
- newline-and-indent goto 1 set soko-cmd 5 soko-init-long-wall " " " set soko-cmd 6 soko-init-long-wall "...##
- newline-and-indent goto 5 set soko-cmd 5 soko-init-long-wall " " " " set soko-cmd 5 soko-init-long-wall
- close-fold
- next-line
- ;OCL}}}
- )
- )
- ;OCL}}}
- ;OCL{{{ soko-init-board-4
- ( deffun soko-init-board-4
- (
- ;OCL{{{ 31
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 3 "####
- newline-and-indent goto 3 "# " " set soko-cmd 9 soko-init-long-wall
- newline-and-indent goto 2 "## " " "## " " "# " " " "#
- newline-and-indent goto 2 "# " " "$# " "$@$ " " " "####
- newline-and-indent goto 2 "#$ " " "$ " " "# " "$ " "$# " " "##
- newline-and-indent goto 1 "## " " "$## " "#$ " "$ " " " " " "#
- newline-and-indent goto 1 "# " " "# " " "# " "# " " " "$$ "$ " " "#
- newline-and-indent goto 1 "# " "$ " " " " "$ " " "$## " "####
- newline-and-indent goto 1 "# " "$ " "$ " "#$# " " "# " " "#
- newline-and-indent goto 1 "## " " "### " " "###$ " "#
- newline-and-indent goto 2 "# " " "#.... " " " " " "#
- newline-and-indent goto 2 "####......####
- newline-and-indent goto 4 "#....####
- newline-and-indent goto 4 "#...##
- newline-and-indent goto 4 "#...#
- newline-and-indent goto 4 set soko-cmd 5 soko-init-long-wall
- close-fold
- next-line
- ;OCL}}}
- ;OCL{{{ 32
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 7 "####
- newline-and-indent goto 3 set soko-cmd 5 soko-init-long-wall " " "#
- newline-and-indent goto 2 "## " " " " " "$#
- newline-and-indent goto 1 "## " "$ " " "## " "###
- newline-and-indent goto 1 "#@$ " "$ " "# " "$ " " "#
- newline-and-indent goto 1 "#### " "## " " " "$#
- newline-and-indent goto 2 "#....#$ " "$ " "#
- newline-and-indent goto 2 "#....# " " " "$#
- newline-and-indent goto 2 "#.... " " "$$ " "##
- newline-and-indent goto 2 "#... " "# " "$ " " " "#
- newline-and-indent goto 2 set soko-cmd 6 soko-init-long-wall "$ " "$ " " "#
- newline-and-indent goto 7 "# " " " "###
- newline-and-indent goto 7 "#$ " "###
- newline-and-indent goto 7 "# " " "#
- newline-and-indent goto 7 "####
- close-fold
- next-line
- ;OCL}}}
- ;OCL{{{ 33
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 1 set soko-cmd 12 soko-init-long-wall
- newline-and-indent goto 1 "## " " " " " "## " " "#
- newline-and-indent goto 1 "## " " " "$ " " " "$ " "#
- newline-and-indent goto 1 "#### " "## " "$$ " "#
- newline-and-indent goto 1 "# " " " "$ " "# " " " " "#
- newline-and-indent goto 1 "# " "$$ "$ " "# " "####
- newline-and-indent goto 1 "# " " " "# " "# " "$ " "##
- newline-and-indent goto 1 "# " " "# " " "# " " "$ " "#
- newline-and-indent goto 1 "# " "$# " "$# " " " " "#
- newline-and-indent goto 1 "# " " " "..# " "####
- newline-and-indent goto 1 "####.. " "$ " "#@#
- newline-and-indent goto 1 "#.....# " "$# " "#
- newline-and-indent goto 1 "##....# " " "$ " "#
- newline-and-indent goto 1 "###..## " " " " "#
- newline-and-indent goto 1 set soko-cmd 12 soko-init-long-wall
- close-fold
- next-line
- ;OCL}}}
- ;OCL{{{ 34
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 2 set soko-cmd 9 soko-init-long-wall
- newline-and-indent goto 2 "#.... " " " "##
- newline-and-indent goto 2 "#.#.# " " "$ " "##
- newline-and-indent goto 1 "##....# " "# " "@##
- newline-and-indent goto 1 "# " "....# " " "# " " "##
- newline-and-indent goto 1 "# " " " " " "#$ " "##$ " "#
- newline-and-indent goto 1 "## " "### " " "$ " " " " "#
- newline-and-indent goto 2 "#$ " " "$ " "$ " "$# " " "#
- newline-and-indent goto 2 "# " "# " " "$ " "$ " "## " "#
- newline-and-indent goto 2 "# " " "### " " "## " " "#
- newline-and-indent goto 2 "# " " " " "## " "## " "##
- newline-and-indent goto 2 "# " " "$ " "# " " "$ " " "#
- newline-and-indent goto 2 "###$ " "$ " " " "###
- newline-and-indent goto 4 "# " " set soko-cmd 5 soko-init-long-wall
- newline-and-indent goto 4 "####
- close-fold
- next-line
- ;OCL}}}
- ;OCL{{{ 35
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 1 set soko-cmd 12 soko-init-long-wall " set soko-cmd 6 soko-init-long-wall
- newline-and-indent goto 1 "# " " " "# " " " " "# " "###....#
- newline-and-indent goto 1 "# " " " "$$ "# " " " "@ " " ".....#
- newline-and-indent goto 1 "# " " " "# " "### " " " "# " "....#
- newline-and-indent goto 1 "## " "## " "### " " "# " " "....#
- newline-and-indent goto 2 "# " "$ " "$ " " " " " "# " "# " "####
- newline-and-indent goto 2 "# " " "$ " "$## " " "# goto 19 "#
- newline-and-indent goto 1 "#### " "# " " "#### " "# " "## " "#
- newline-and-indent goto 1 "# " " "# " "#$ " " " "## " "# " " " " "#
- newline-and-indent goto 1 "# " "$ " " "$ " " "# " "## " "# " " " "##
- newline-and-indent goto 1 "# " "# " "$ " "$ " " " " "# " "# " " " "#
- newline-and-indent goto 1 "# " " "$ " "## " "## " "# " set soko-cmd 5 soko-init-long-wall
- newline-and-indent goto 1 "# " "$$ " " " " " "$$ " " "#
- newline-and-indent goto 1 "## " "## " "### " "$ " " "#
- newline-and-indent goto 2 "# " " " " "# " "# " " " " "#
- newline-and-indent goto 2 set soko-cmd 6 soko-init-long-wall " set soko-cmd 6 soko-init-long-wall
- close-fold
- next-line
- ;OCL}}}
- ;OCL{{{ 36
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 13 set soko-cmd 5 soko-init-long-wall
- newline-and-indent goto 1 set soko-cmd 5 soko-init-long-wall " " set soko-cmd 6 soko-init-long-wall " " " "#
- newline-and-indent goto 1 "# " " " "#### " " "$ " "$ " "$ " "#
- newline-and-indent goto 1 "# " "$ " " " "## " "## " "## " " "##
- newline-and-indent goto 1 "# " " " "$ " "$ " " " " " "$ " " "$ " "#
- newline-and-indent goto 1 "### " "$ " " "## " "## " " " " " "##
- newline-and-indent goto 3 "# " set soko-cmd 5 soko-init-long-wall " set soko-cmd 5 soko-init-long-wall "$$ " "#
- newline-and-indent goto 2 "##$ set soko-cmd 5 soko-init-long-wall " "@## " " " " " "#
- newline-and-indent goto 2 "# " "$ " " "###$### " "$ " " "##
- newline-and-indent goto 2 "# " "$ " " "# " " " "### " " "###
- newline-and-indent goto 2 "# " "$$ " "$ " "# " " " "$$ " "#
- newline-and-indent goto 2 "# " " " " " "# " " " "## " " "#
- newline-and-indent goto 2 set soko-cmd 7 soko-init-long-wall ".. " ".###
- newline-and-indent goto 5 "#.........#
- double-line
- newline-and-indent goto 5 set soko-cmd 11 soko-init-long-wall
- close-fold
- next-line
- ;OCL}}}
- ;OCL{{{ 37
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 1 set soko-cmd 11 soko-init-long-wall
- newline-and-indent goto 1 "#...... " " " set soko-cmd 9 soko-init-long-wall
- newline-and-indent goto 1 "#...... " " " "# " " "## " " " "#
- newline-and-indent goto 1 "#..### " "$ " " " " "$ " " " " " "#
- newline-and-indent goto 1 "#... " "$ " "$ " "# " " " "## " " " "#
- newline-and-indent goto 1 "#...#$ set soko-cmd 5 soko-init-long-wall " " " " "# " " "#
- newline-and-indent goto 1 "### " " " " "# " " " "#$ " " "#$ " "#
- newline-and-indent goto 3 "# " " "$$ " "$ " "$ " " "$## " " "#
- newline-and-indent goto 3 "# " " "$ " " " "#$#$ " "##$ " "#
- newline-and-indent goto 3 "### " "## " "# " " " " "## " " "#
- newline-and-indent goto 4 "# " " "$ " "$ " "## " set soko-cmd 6 soko-init-long-wall
- newline-and-indent goto 4 "# " " " " "$ " " "$ " " "#
- newline-and-indent goto 4 "## " " " "# " "# " " " "#
- newline-and-indent goto 5 set soko-cmd 5 soko-init-long-wall "@ set soko-cmd 5 soko-init-long-wall
- newline-and-indent goto 9 "###
- close-fold
- next-line
- ;OCL}}}
- ;OCL{{{ 38
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 7 "####
- newline-and-indent goto 1 set soko-cmd 7 soko-init-long-wall " "@#
- newline-and-indent goto 1 "# " " " " " "$ " " "#
- newline-and-indent goto 1 "# " " " "$## " "$#
- newline-and-indent goto 1 "##$#...# " "#
- newline-and-indent goto 2 "# " "$... " " "#
- newline-and-indent goto 2 "# " "#. " ".# " "##
- newline-and-indent goto 2 "# " " " "# " "#$ " "#
- newline-and-indent goto 2 "#$ " " "$ " " " " "#
- newline-and-indent goto 2 "# " " set soko-cmd 7 soko-init-long-wall
- newline-and-indent goto 2 "####
- close-fold
- next-line
- ;OCL}}}
- ;OCL{{{ 39
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 14 set soko-cmd 6 soko-init-long-wall
- newline-and-indent goto 2 set soko-cmd 13 soko-init-long-wall "....#
- newline-and-indent goto 1 "## " " " "## " " " " " "##....#
- newline-and-indent goto 1 "# " " "$$ "## " " "$ " "@##....#
- newline-and-indent goto 1 "# goto 8 "$$ " "$# " " "....#
- newline-and-indent goto 1 "# " " "$ " "## " "$$ " "# " "# " "...#
- newline-and-indent goto 1 "# " " "$ " "## " "$ " " "# " " "....#
- newline-and-indent goto 1 "## " set soko-cmd 5 soko-init-long-wall " "### " "##.###
- newline-and-indent goto 1 "## " " " "$ " " "$ " "## " " " ". " " "#
- newline-and-indent goto 1 "# " "$### " " "# " set soko-cmd 5 soko-init-long-wall " "###
- newline-and-indent goto 1 "# " " " "$ " " " "# goto 17 "#
- newline-and-indent goto 1 "# " " "$ " "#$ " "$ " "$### " " "#
- newline-and-indent goto 1 "# " "$$ "$# " "$ " " " "# " "####
- newline-and-indent goto 1 "# " " " " "# " " "$$ " "#
- newline-and-indent goto 1 set soko-cmd 6 soko-init-long-wall " " " "###
- newline-and-indent goto 6 set soko-cmd 5 soko-init-long-wall
- close-fold
- next-line
- ;OCL}}}
- )
- )
- ;OCL}}}
- ;OCL{{{ soko-init-board-5
- ( deffun soko-init-board-5
- (
- ;OCL{{{ 40
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 5 set soko-cmd 12 soko-init-long-wall
- newline-and-indent goto 5 "# goto 16 "##
- newline-and-indent goto 5 "# " " "# " "#$$ " "$ " " "#
- newline-and-indent goto 5 "#$ " "#$# " " "## " "@#
- newline-and-indent goto 4 "## " "## " "# " "$ " "# " "##
- newline-and-indent goto 4 "# " " " "$ " "#$ " " "# " "#
- newline-and-indent goto 4 "# " " " "# " "$ " " " "# " "#
- newline-and-indent goto 4 "## " "$ " "$ " " " "## " "#
- newline-and-indent goto 4 "# " " "# " " "## " " "$ " "#
- newline-and-indent goto 4 "# " " " " "## " "$$ "# " "#
- newline-and-indent goto 1 set soko-cmd 6 soko-init-long-wall "$$ " " " "# " " " "#
- newline-and-indent goto 1 "#....# " " set soko-cmd 8 soko-init-long-wall
- newline-and-indent goto 1 "#.#... " "##
- newline-and-indent goto 1 "#.... " " " "#
- double-line
- newline-and-indent goto 1 set soko-cmd 9 soko-init-long-wall
- close-fold
- next-line
- ;OCL}}}
- ;OCL{{{ 41
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 12 set soko-cmd 5 soko-init-long-wall
- newline-and-indent goto 11 "## " " " "##
- newline-and-indent goto 10 "## " " " " " "#
- newline-and-indent goto 9 "## " " "$$ " " "#
- newline-and-indent goto 8 "## " "$$ " " "$ " "#
- newline-and-indent goto 8 "# " "$ " " " " "$ " "#
- newline-and-indent goto 1 "#### " " " "# " " " "$$ " set soko-cmd 5 soko-init-long-wall
- newline-and-indent goto 1 "# " " set soko-cmd 8 soko-init-long-wall " "## " " " " "#
- newline-and-indent goto 1 "#. goto 15 "$$ "$@#
- newline-and-indent goto 1 "#.# " set soko-cmd 7 soko-init-long-wall " "## " " " "##
- newline-and-indent goto 1 "#.# " set soko-cmd 7 soko-init-long-wall ". " "#$ " "$##
- newline-and-indent goto 1 "#........... " "# " " " " "#
- newline-and-indent goto 1 set soko-cmd 14 soko-init-long-wall " " "$ " "#
- newline-and-indent goto 14 "## " " "##
- newline-and-indent goto 15 "####
- close-fold
- next-line
- ;OCL}}}
- ;OCL{{{ 42
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 6 set soko-cmd 8 soko-init-long-wall
- newline-and-indent goto 3 "#### goto 13 set soko-cmd 6 soko-init-long-wall
- newline-and-indent goto 3 "# " " " " "## " "$ " "$ " " " "@#
- newline-and-indent goto 3 "# " "## " "##$#$ " "$ " "$##
- newline-and-indent goto 1 "### " "......# " " "$$ " "##
- newline-and-indent goto 1 "# " " " "......# " " "# " " " "#
- newline-and-indent goto 1 "# " "# " "......#$ " " "$ " " "#
- newline-and-indent goto 1 "# " "#$...... " "$$ "# " "$ " "#
- newline-and-indent goto 1 "# " " " "### " "###$ " " "$ " "##
- newline-and-indent goto 1 "### " " "$ " " "$ " " "$ " " "$ " "#
- newline-and-indent goto 3 "# " " "$ " " "$ " " "$ " " "$ " "#
- newline-and-indent goto 3 set soko-cmd 6 soko-init-long-wall " " " set soko-cmd 6 soko-init-long-wall
- newline-and-indent goto 8 set soko-cmd 5 soko-init-long-wall
- close-fold
- next-line
- ;OCL}}}
- ;OCL{{{ 43
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 9 set soko-cmd 7 soko-init-long-wall
- newline-and-indent goto 5 set soko-cmd 5 soko-init-long-wall " " "# " " "####
- newline-and-indent goto 5 "# " " " "# " " " "$ " " " " "#
- newline-and-indent goto 2 "#### " "#$$ " "## " "## " " "#
- newline-and-indent goto 1 "## goto 9 "# " "# " " "## " "###
- newline-and-indent goto 1 "# " " "### " "$#$ " " "$ " " "$ " " "#
- newline-and-indent goto 1 "#... " " " " "# " "## " " "# " " " "#
- newline-and-indent goto 1 "#...# " " " " "@ " "# " "### " "##
- newline-and-indent goto 1 "#...# " " "### " " "$ " " "$ " " "#
- newline-and-indent goto 1 set soko-cmd 8 soko-init-long-wall " "## " " " "# " " " "#
- newline-and-indent goto 11 set soko-cmd 9 soko-init-long-wall
- close-fold
- next-line
- ;OCL}}}
- ;OCL{{{ 44
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 2 set soko-cmd 5 soko-init-long-wall
- newline-and-indent goto 2 "# " " " "#
- newline-and-indent goto 2 "# " "# " set soko-cmd 7 soko-init-long-wall
- newline-and-indent goto 2 "# goto 9 "$@ set soko-cmd 6 soko-init-long-wall
- newline-and-indent goto 2 "# " "$ " "##$ " "### " " " "#
- newline-and-indent goto 2 "# " "#### " "$ " " " " "$ " "#
- newline-and-indent goto 2 "# " set soko-cmd 5 soko-init-long-wall " "# " " "#$ " "####
- newline-and-indent goto 1 "## " " "#### " "##$ goto 19 "#
- newline-and-indent goto 1 "# " " "$# " " "$ " " "# " "## " "## " "#
- newline-and-indent goto 1 "# goto 11 "# " "#...# " "#
- newline-and-indent goto 1 set soko-cmd 6 soko-init-long-wall " " "### " " "... " " "#
- newline-and-indent goto 6 "#### " "# " "#...# " "#
- newline-and-indent goto 11 "# " "### " "# " "#
- newline-and-indent goto 11 "# goto 19 "#
- newline-and-indent goto 11 set soko-cmd 9 soko-init-long-wall
- close-fold
- next-line
- ;OCL}}}
- ;OCL{{{ 45
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 1 set soko-cmd 5 soko-init-long-wall " "####
- newline-and-indent goto 1 "#...# " "# " " "####
- newline-and-indent goto 1 "#...### " " "$ " " "#
- newline-and-indent goto 1 "#....## " "$ " " "$###
- newline-and-indent goto 1 "##....## " " " "$ " " "#
- newline-and-indent goto 1 "###... " "## " "$ " "$ " "#
- newline-and-indent goto 1 "# " "## " " " " "# " " "$ " " "#
- newline-and-indent goto 1 "# " " "## " "# " "### " "####
- newline-and-indent goto 1 "# " "$ " "# " "#$ " " "$ " " " " "#
- newline-and-indent goto 1 "# " " "$ " "@ " "$ " " " " "$ " " "#
- newline-and-indent goto 1 "# " " " "# " "$ " "$$ " "$ " "###
- newline-and-indent goto 1 "# " " set soko-cmd 6 soko-init-long-wall " " "###
- newline-and-indent goto 1 "# " "## " " " " "####
- newline-and-indent goto 1 "###
- close-fold
- next-line
- ;OCL}}}
- ;OCL{{{ 46
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 1 set soko-cmd 10 soko-init-long-wall
- newline-and-indent goto 1 "# goto 10 "####
- newline-and-indent goto 1 "# " set soko-cmd 6 soko-init-long-wall " "# " " "##
- newline-and-indent goto 1 "# " "# " "$ " "$ " "$ " " "$ " "#
- newline-and-indent goto 1 "# goto 9 "#$ " " " "#
- newline-and-indent goto 1 "###$ " " "$$ "# " " "###
- newline-and-indent goto 3 "# " " "## " "# " "$##
- newline-and-indent goto 3 "##$# " " " "$ " "@#
- newline-and-indent goto 4 "# " " "$ " "$ " "###
- newline-and-indent goto 4 "# " "# " " " "$ " " "#
- newline-and-indent goto 4 "# " "## " " " "# " "#
- newline-and-indent goto 3 "## " " set soko-cmd 5 soko-init-long-wall " "#
- newline-and-indent goto 3 "# goto 13 "#
- newline-and-indent goto 3 "#.......###
- newline-and-indent goto 3 "#.......#
- newline-and-indent goto 3 set soko-cmd 9 soko-init-long-wall
- close-fold
- next-line
- ;OCL}}}
- ;OCL{{{ 47
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 10 "####
- newline-and-indent goto 2 set soko-cmd 9 soko-init-long-wall " " "##
- newline-and-indent goto 1 "## " " "$ goto 12 "$ " set soko-cmd 5 soko-init-long-wall
- newline-and-indent goto 1 "# " " " "## " "## " " " "##...#
- newline-and-indent goto 1 "# " "#$$ " "$ " "$$ "#$##...#
- newline-and-indent goto 1 "# " "# " " " "@ " " " "# " " " "...#
- newline-and-indent goto 1 "# " " "$# " "###$$ " " " "...#
- newline-and-indent goto 1 "# " "$ " " "$$ " " "$ " "##....#
- newline-and-indent goto 1 "###$ goto 12 set soko-cmd 7 soko-init-long-wall
- newline-and-indent goto 3 "# " " set soko-cmd 7 soko-init-long-wall
- newline-and-indent goto 3 "####
- close-fold
- next-line
- ;OCL}}}
- ;OCL{{{ 48
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 3 set soko-cmd 9 soko-init-long-wall
- newline-and-indent goto 3 "#*.*#*.*#
- newline-and-indent goto 3 "#.*.*.*.#
- newline-and-indent goto 3 "#*.*.*.*#
- newline-and-indent goto 3 "#.*.*.*.#
- newline-and-indent goto 3 "#*.*.*.*#
- newline-and-indent goto 3 "### " " " "###
- newline-and-indent goto 5 "# " " " "#
- newline-and-indent goto 1 set soko-cmd 6 soko-init-long-wall " set soko-cmd 6 soko-init-long-wall
- newline-and-indent goto 1 "# goto 13 "#
- newline-and-indent goto 1 "# " "$ " "$ " "$ " "$ " "$ " "#
- newline-and-indent goto 1 "## " "$ " "$ " "$ " "$ " "##
- newline-and-indent goto 2 "#$ " "$ " "$ " "$ " "$#
- newline-and-indent goto 2 "# " " " "$@$ " " " "#
- newline-and-indent goto 2 "# " " set soko-cmd 5 soko-init-long-wall " " "#
- newline-and-indent goto 2 "#### " " " "####
- close-fold
- next-line
- ;OCL}}}
- ;OCL{{{ 49
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 8 "####
- newline-and-indent goto 8 "# " " "##
- newline-and-indent goto 8 "# " " " "##
- newline-and-indent goto 8 "# " "$$ " "##
- newline-and-indent goto 6 "###$ " " "$ " "##
- newline-and-indent goto 3 "#### " " " " "$ " " " "#
- newline-and-indent goto 1 "### " " "# " set soko-cmd 5 soko-init-long-wall " " "#
- newline-and-indent goto 1 "# " " " " "# " "#....$ " "#
- newline-and-indent goto 1 "# " "# " " " "$ " "....# " "#
- newline-and-indent goto 1 "# " " "$ " "# " "#.*..# " "#
- newline-and-indent goto 1 "### " " "#### " "### " "#
- newline-and-indent goto 3 "#### " "@$ " " "##$##
- newline-and-indent goto 6 "### " "$ " " " " " "#
- newline-and-indent goto 8 "# " " "## " " " "#
- newline-and-indent goto 8 set soko-cmd 9 soko-init-long-wall
- close-fold
- next-line
- ;OCL}}}
- ;OCL{{{ 50
- goto 1 create-fold create-fold
- open-fold
- newline-and-indent goto 7 set soko-cmd 12 soko-init-long-wall
- newline-and-indent goto 6 "##.. " " " " "# " " " "#
- newline-and-indent goto 5 "##..* " "$ " " " " "$ " "#
- newline-and-indent goto 4 "##..*.# " "# " "# " "$##
- newline-and-indent goto 4 "#..*.# " "# " "# " "$ " " "#
- newline-and-indent goto 1 "####...# " " "# " " " " "# " "#
- newline-and-indent goto 1 "# " " "## " "# goto 18 "#
- newline-and-indent goto 1 "# " "@$ " "$ " "### " " "# " " " "##
- newline-and-indent goto 1 "# " "$ " " " "$ " " " "# " "# " " " "#
- newline-and-indent goto 1 "###$$ " " " "# " "# " "# " "# " "#
- newline-and-indent goto 3 "# " " " "$ " " " "# " "# " set soko-cmd 5 soko-init-long-wall
- newline-and-indent goto 3 "# " "$# " set soko-cmd 5 soko-init-long-wall goto 19 "#
- newline-and-indent goto 3 "#$ " " " "# " " " "# " " " " "# " "#
- newline-and-indent goto 3 "# " " "### " " " "## " " " " " "#
- newline-and-indent goto 3 "# " " "# goto 13 "# " " " " "##
- newline-and-indent goto 3 "#### goto 13 set soko-cmd 6 soko-init-long-wall
- close-fold
- next-line
- ;OCL}}}
- )
- )
- ;OCL}}}
-
- ;OCL{{{ soko-init-boards
- ( defmac soko-init-boards
- (
- ;OCL{{{ create the levels
- soko-init-board-1 load-function not(soko-init-board-1)
- soko-init-board-2 load-function not(soko-init-board-2)
- soko-init-board-3 load-function not(soko-init-board-3)
- soko-init-board-4 load-function not(soko-init-board-4)
- soko-init-board-5 load-function not(soko-init-board-5)
- load-function not(soko-init-long-wall)
- ;OCL}}}
- ;OCL{{{ generate the fold-labels
- set soko-cmd 0
- beginning-of-fold
- while pre ( next-line ) not( test-bottom )
- ( set soko-cmd +(soko-cmd 1)
- end-of-line
- "level. counter soko-cmd
- )
- ;OCL}}}
- if not(test-language Inmos) ( set-language Inmos ) fi
- )
- )
- ;OCL}}}
- ;OCL{{{ soko-init-unload
- ( defmac soko-init-unload
- ( load-function not
- ( soko-init-board-1
- soko-init-board-2
- soko-init-board-3
- soko-init-board-4
- soko-init-board-5
- soko-init-long-wall
- )
- )
- )
- ;OCL}}}
-
- ;OCL{{{ undeclares
- ( undeclare
- ( soko-init-board-1
- soko-init-board-2
- soko-init-board-3
- soko-init-board-4
- soko-init-board-5
- soko-init-long-wall
- )
- )
- ;OCL}}}
- ;OCL}}}
- ;OCL{{{ soko-quit
- ( deffun soko-quit
- ( set-file-unchanged
- exit-buffer
- set soko-play false
- )
- )
- ;OCL}}}
- ;OCL{{{ soko-next-level
- ( deffun soko-next-level
- ( screen-off
- exit-fold
- delete-line
- delete-line
- end-of-fold
- undo-delete-line
- save-file
- set soko-cmd soko-quit
- screen-on
- )
- )
- ;OCL}}}
- ;OCL{{{ soko-previous-level
- ( deffun soko-previous-level
- ( screen-off
- exit-fold
- delete-line
- end-of-fold
- previous-line
- delete-line
- goto-line-counter 1
- undo-delete-line
- save-file
- set soko-cmd soko-quit
- screen-on
- )
- )
- ;OCL}}}
- ;OCL{{{ soko-reset
- ( deffun soko-reset
- ( screen-off
- exit-fold
- if soko-saved
- ( undo-delete-line
- next-line
- delete-line
- previous-line
- double-line
- delete-line
- previous-line
- enter-fold
- repeat soko-saved-y ( next-line )
- goto soko-saved-x
- set soko-homes soko-saved-homes
- set soko-mv soko-saved-mv
- set soko-pu soko-saved-pu
- )
- else
- ( delete-line
- set soko-cmd soko-quit
- )
- fi
- screen-on
- redraw-display
- )
- )
- ;OCL}}}
- ;OCL{{{ soko-save
- ( deffun soko-save
- ( screen-off
- set soko-saved-x store-pos
- set soko-saved-y -(store-line 2)
- set soko-saved-homes soko-homes
- set soko-saved-mv soko-mv
- set soko-saved-pu soko-pu
- exit-fold
- double-line
- delete-line
- previous-line
- enter-fold
- set soko-saved true
- screen-on
- soko-reset
- message "Saved!
- show-cursor 10
- )
- )
- ;OCL}}}
- ;OCL{{{ soko-restart-level
- ( deffun soko-restart-level
- ( set soko-saved false
- soko-reset
- )
- )
- ;OCL}}}
- ;OCL{{{ soko-action
- ( deffun ( move i-move repeat-mode ) soko-action
- ( do
- ;OCL{{{ do a single move
- ( insert-ascii move
- case
- ;OCL{{{ base or ground -> moved ok
- ( or(test-char " test-char ".)
- ( set soko-mv +(soko-mv 1)
- set soko-undo true
- set soko-undo-push false
- set soko-undo-move move
- set soko-undo-i-move i-move
- )
- )
- ;OCL}}}
- ;OCL{{{ stone -> stop or push
- ( or(test-char "$ test-char "S)
- ( if <(repeat-mode 0)
- ;OCL{{{ running stops!
- ( insert-ascii i-move
- set repeat-mode false
- )
- ;OCL}}}
- else
- ;OCL{{{ try to shift the block
- ( insert-ascii move
- case
- ;OCL{{{ base or ground -> shift
- ( or(test-char " test-char ".)
- (
- ;OCL{{{ draw shifted stone
- if test-char ".
- ( set soko-homes -(soko-homes 1)
- "S
- if not(test-overwrite)
- ( forward-character
- delete-previous-character
- )
- fi
- backward-character
- )
- else
- ( "$
- if not(test-overwrite)
- ( forward-character
- delete-previous-character
- )
- fi
- backward-character
- )
- fi
- ;OCL}}}
- insert-ascii i-move
- ;OCL{{{ delete shifted stone
- if test-char "S
- ( set soko-homes +(soko-homes 1)
- ".
- if not(test-overwrite)
- ( forward-character
- delete-previous-character
- )
- fi
- backward-character
- )
- else
- ( " ;
- if not(test-overwrite)
- ( forward-character
- delete-previous-character
- )
- fi
- backward-character
- )
- fi
- ;OCL}}}
- set soko-mv +(soko-mv 1)
- set soko-pu +(soko-pu 1)
- set soko-undo true
- set soko-undo-push true
- set soko-undo-move move
- set soko-undo-i-move i-move
- )
- )
- ;OCL}}}
- default
- ;OCL{{{ failed
- ( insert-ascii i-move
- insert-ascii i-move
- set repeat-mode false
- )
- ;OCL}}}
- esac
- )
- ;OCL}}}
- fi
- )
- )
- ;OCL}}}
- default
- ;OCL{{{ failed
- ( insert-ascii i-move
- set repeat-mode false
- )
- ;OCL}}}
- esac
- )
- ;OCL}}}
- while repeat-mode
- if =(soko-homes 0)
- ;OCL{{{ up to he next level!
- ( message ("Hip " "Hip " "Hurra!)
- show-cursor 20
- soko-next-level
- )
- ;OCL}}}
- fi
- sokoban-kbd
- )
- )
- ;OCL}}}
- ;OCL{{{ soko-undo-last-move
- ( deffun soko-undo-last-move
- ( if soko-undo
- ( if soko-undo-push
- ( insert-ascii soko-undo-move
- insert-ascii soko-undo-move
- soko-action(soko-undo-i-move soko-undo-move 0)
- insert-ascii soko-undo-move ; soko-action stored the move!
- insert-ascii soko-undo-move ; so don't use i-move!
- set soko-mv -(soko-mv 2)
- set soko-pu -(soko-pu 2)
- )
- else
- ( insert-ascii soko-undo-i-move
- set soko-mv -(soko-mv 1)
- )
- fi
- set soko-undo false
- )
- fi
- )
- )
- ;OCL}}}
- ;OCL{{{ soko-describe-bindings
- ( deffun soko-describe-bindings
- ( sokoban-kbd
- describe-bindings
- while in-prompt
- ( begin-prompt-macro
- prompt-char-counter soko-cmd ()
- end-prompt-macro
- insert-ascii soko-cmd
- )
- )
- )
- ;OCL}}}
- ;OCL{{{ up
- ( deffun soko-go-or-push-up ( soko-action(previous-line next-line 0 ) ) )
- ( deffun soko-run-or-push-up ( soko-action(previous-line next-line 1 ) ) )
- ( deffun soko-run-up ( soko-action(previous-line next-line -1 ) ) )
- ;OCL}}}
- ;OCL{{{ down
- ( deffun soko-go-or-push-down ( soko-action(next-line previous-line 0 ) ) )
- ( deffun soko-run-or-push-down ( soko-action(next-line previous-line 1 ) ) )
- ( deffun soko-run-down ( soko-action(next-line previous-line -1 ) ) )
- ;OCL}}}
- ;OCL{{{ left
- ( deffun soko-go-or-push-left ( soko-action(backward-character forward-character 0 ) ) )
- ( deffun soko-run-or-push-left ( soko-action(backward-character forward-character 1 ) ) )
- ( deffun soko-run-left ( soko-action(backward-character forward-character -1 ) ) )
- ;OCL}}}
- ;OCL{{{ right
- ( deffun soko-go-or-push-right ( soko-action(forward-character backward-character 0 ) ) )
- ( deffun soko-run-or-push-right ( soko-action(forward-character backward-character 1 ) ) )
- ( deffun soko-run-right ( soko-action(forward-character backward-character -1 ) ) )
- ;OCL}}}
- ;OCL{{{ soko-unload
- ;OCL{{{ soko-unload-
- ( deffun soko-unload-
- ( soko-init-unload
- load-function not
- ( soko-quit
- soko-next-level
- soko-previous-level
- soko-save
- soko-reset
- soko-restart-level
- soko-action
- soko-undo-last-move
- soko-describe-bindings
- soko-go-or-push-up
- soko-run-or-push-up
- soko-run-up
- soko-go-or-push-down
- soko-run-or-push-down
- soko-run-down
- soko-go-or-push-left
- soko-run-or-push-left
- soko-run-left
- soko-go-or-push-right
- soko-run-or-push-right
- soko-run-right
- )
- )
- )
- ;OCL}}}
-
- ( defmac soko-unload
- ( soko-unload-
- load-function not(soko-unload-)
- )
- )
-
- ;OCL{{{ undeclares
- ( undeclare ( soko-unload- ) )
- ;OCL}}}
- ;OCL}}}
-
- ( deffun sokoban
- ( save-buffer-layout
- set soko-play true
- ;OCL{{{ open full window sized sokoban buffer
- screen-off
- open-buffer
- @if-using ( SOKOBAN-FILE )
- SOKOBAN-FILE
- @fi
- @if-using not( SOKOBAN-FILE )
- "~/.orisokoban
- @fi
- newline-and-indent
- full-size-buffer
- delete-mode-view
- delete-mode-hash-shift
- goto-line-counter 1
- if test-bottom
- ;OCL{{{ init my 50 predefined levels
- ( soko-init-boards
- save-file
- )
- ;OCL}}}
- fi
- screen-on
- ;OCL}}}
- ;OCL{{{ play loop
- do
- ( screen-off
- goto-line-counter 1
- double-line
- previous-line
- set soko-mv 0
- set soko-pu 0
- ;OCL{{{ save regexp state
- delete-mode-regular-expression
- set soko-regexp +(ocl-argument 1)
- ;OCL}}}
- ;OCL{{{ get bases
- enter-fold
- goto 1
- replace-string
- ". newline-and-indent
- ". newline-and-indent
- set soko-homes ocl-argument
- ;OCL}}}
- ;OCL{{{ mark saved pakets with S, instead of *
- exit-fold
- enter-fold
- goto 1
- replace-string
- "* newline-and-indent
- "S newline-and-indent
- ;OCL}}}
- ;OCL{{{ move to cursor and maybe correct bases
- exit-fold
- enter-fold
- goto 1
- replace-string
- "@ newline-and-indent
- " newline-and-indent
- if =(0 ocl-argument)
- ( replace-string
- "+ newline-and-indent
- ". newline-and-indent
- set soko-homes +(soko-homes 1)
- )
- fi
- backward-character
- ;OCL}}}
- ;OCL{{{ reset regexp state
- case
- ( =(2 soko-regexp) ( add-mode-basic-regular-expression ) )
- ( =(3 soko-regexp) ( add-mode-extended-regular-expression ) )
- esac
- set soko-regexp 0
- ;OCL}}}
- screen-on
- redraw-display
- set soko-undo false
- set soko-saved false
- do
- ( set-file-unchanged
- message
- ( "Moves: counter soko-mv
- " "Pushes: counter soko-pu
- " " " "Pakets " "to " "store: counter soko-homes
- )
- show-cursor 0
- sokoban-kbd
- prompt-char-counter soko-cmd ()
- SOKOBAN-RESET-KBD
- if >(soko-cmd no-operation) ( insert-ascii soko-cmd ) fi
- )
- while <>(soko-cmd soko-quit)
- )
- while soko-play
- ;OCL}}}
- soko-unload
- restore-buffer-layout
- )
- )
- ;OCL}}}
- ;OCL{{{ define sokoban play keyboard
- ( mode sokoban-kbd
- ;OCL{{{ up
- ( keybind soko-go-or-push-up ( "k ) )
- ( keybind soko-run-or-push-up ( "K ) )
- ( keybind soko-run-up ( C-K ) )
- ;OCL}}}
- ;OCL{{{ down
- ( keybind soko-go-or-push-down ( "j ) )
- ( keybind soko-run-or-push-down ( "J ) )
- ( keybind soko-run-down ( C-J ) )
- ;OCL}}}
- ;OCL{{{ left
- ( keybind soko-go-or-push-left ( "h ) )
- ( keybind soko-run-or-push-left ( "H ) )
- ( keybind soko-run-left ( C-H ) )
- ;OCL}}}
- ;OCL{{{ right
- ( keybind soko-go-or-push-right ( "l ) )
- ( keybind soko-run-or-push-right ( "L ) )
- ( keybind soko-run-right ( C-L ) )
- ;OCL}}}
- ;OCL{{{ undo
- ( keybind soko-undo-last-move ( "u ) )
- ;OCL}}}
- ;OCL{{{ quit
- ( keybind soko-quit ( "q ) )
- ;OCL}}}
- ;OCL{{{ next
- ( keybind soko-next-level ( "+ ) )
- ;OCL}}}
- ;OCL{{{ previous
- ( keybind soko-previous-level ( "- ) )
- ;OCL}}}
- ;OCL{{{ save
- ( keybind soko-save ( "s ) )
- ;OCL}}}
- ;OCL{{{ reset
- ( keybind soko-reset ( "r ) )
- ;OCL}}}
- ;OCL{{{ restart
- ( keybind soko-restart-level ( "R ) )
- ;OCL}}}
- ;OCL{{{ describe-bindings
- ( keybind soko-describe-bindings ( "? ) )
- ;OCL}}}
- )
- ;OCL}}}
- ;OCL{{{ abort-hook-add
- @if-using not(ABORT-HOOK-ADD)
- @use (ABORT-HOOK-ADD)
- ( defmac abort-hook-add ( ) )
- @fi
- ( defmac abort-hook-add-saved ( abort-hook-add ) )
- ( undeclare ( abort-hook-add ) )
- ( defmac abort-hook-add
- ( abort-hook-add-saved
- case
- ( =(1 soko-regexp) ( delete-mode-regular-expression ) )
- ( =(2 soko-regexp) ( add-mode-basic-regular-expression ) )
- esac
- if soko-play
- ( set soko-play false
- set-file-unchanged exit-buffer
- restore-buffer-layout
- )
- fi
- )
- )
- ( undeclare ( abort-hook-add-saved ) )
- ;OCL}}}
- ;OCL{{{ reference hooks
- @if-using ( FUN-REFERENCE ) ; 3 ;
- The libary defines a macro `abort-hook-add' and a OCL tag ABORT-HOOK-ADD.
- This macro should be added to your abort-macro! If needed, an existing
- macro `abort-hook-add' will be integrated!
-
- The libary functions are marked as demand-loading.
-
- If you do not wnt to use the default file `~/.orisokoban', define the tag
- and function SOKOBAN-FILE.
- @fi
- ;OCL}}}
- ;OCL{{{ undeclares
- ( undeclare
- ( soko-regexp
- soko-homes
- soko-play
- soko-cmd
- soko-mv
- soko-pu
- soko-undo
- soko-undo-push
- soko-undo-move
- soko-undo-i-move
- soko-saved
- soko-saved-y
- soko-saved-x
- soko-saved-homes
- soko-saved-mv
- soko-saved-pu
- soko-init-boards
- soko-init-unload
- soko-quit
- soko-next-level
- soko-previous-level
- soko-save
- soko-reset
- soko-action
- soko-describe-bindings
- soko-undo-last-move
- soko-unload
- )
- )
- ;OCL}}}
- ) )
- @fi
-